#ifndef EXITDIALOG_H
#define EXITDIALOG_H

#include <QDialog>
#include <yaef_input.h>

namespace Ui {
class ExitDialog;
}

class ExitDialog : public QDialog
{
  Q_OBJECT
  
public:
  enum Action
  {
    ReturnToDesktop,
    Shutdown,
    Cancel
  };

  explicit ExitDialog(QWidget *parent = 0);
  ~ExitDialog();

  void setBackground(const QPixmap& p) { _bg = p; }
  void setInput(InputThread* thread, NativeEventBlocker* eventBlocker);

  Action action() const;

protected slots:
  void key(int k);
protected:
  void paintEvent(QPaintEvent *);
  
private:
  Ui::ExitDialog *ui;
  QPixmap _bg;

  void playSound(const QString& url);
};

#endif // EXITDIALOG_H
